<!--隐患排查录入-->
<include file="public@header" />
</head>
<body style="background-color: #E5F3E6">
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li ><a href="{:url('hiden/index')}">隐患整改信息</a></li>
			<li class="active"><a href="{:url('hiden/add')}">隐患信息填报</a></li>
		</ul>
		<form onSubmit="return   beforeSubmit(this);" method="post" action="{:url('hiden/addpost')}" id="form">
	          <!--隐患填报单-->
	        <div class="row">
				<ol class="breadcrumb" >
			        <li><a href="#">隐患填报单</a></li>
			    </ol>
			</div>
			<div class="row">
				<div class="form-group col-md-6 col-sm-6">
					<label class="col-sm-4 control-label">排查部门
					<span style="color:red;">*</span>
					</label>
					<div class="col-sm-8">
					<input id="facId"  type="text" readonly="readonly" 
						   class="form-control" value ='{$userDepartName}'/>
					</div>
				</div>
				<div class="form-group col-md-6 col-sm-6">
					<label class="col-sm-4 control-label">排查日期
					<span style="color:red;">*</span>
					</label>
					<div class="col-sm-8">
						<input type="text" class="form-control js-bootstrap-date" id="prdateId" name="hidenTime" msg = "排查日期"/>
					</div>
				</div>
				<div class="form-group col-md-6 col-sm-6 ">
					<label class="col-sm-4 control-label person">排查人
					<span style="color:red;">*</span>
					</label>
					<div class="col-sm-8">
						<input type="text" name="hidenPersonName" id ="personId"
						class="form-control" msg = "排查人">
					</div>
				</div>
				<div class="form-group col-md-6 col-sm-6 ">
					<label class="col-sm-4 control-label">排查方式
					<span style="color:red;">*</span>
					</label>
					<div class="col-sm-8">
						<select class="form-control" name="hidenPtrStyleID">
							<foreach name="hidenTypeData" item="vo">
								<option id = '{$vo.partolStyleID}' value='{$vo.partolStyleID}'>{$vo.partolStyleName}</option>
							</foreach>
						</select>
					</div>
				</div>
				<div class="form-group col-md-6 col-sm-6 ">
					<label class="col-sm-4 control-label">隐患类别
					<span style="color:red;">*</span>
					</label>
					<div class="col-sm-8">
						<select class="form-control" name="hidenTypeID">
							<foreach name="dangerTypeData" item="vo">
								<option id = '{$vo.dangerTypeID}' value='{$vo.dangerTypeID}'>{$vo.dangerTypeName}</option>
							</foreach>							
						</select>
					</div>
				</div>
				<div class="form-group col-md-6 col-sm-6">
					<label class="col-sm-4  control-label">隐患级别
					<span style="color:red;">*</span>
					</label>
					<div class="col-sm-8">
						<select class="form-control" name="hidenLevel">
							<option value="一般">一般</option>
							<option value="重大">重大</option>
						</select>
					</div>
				</div>
				<div class="form-group col-md-6 col-sm-6">
					<label for="inputgsmc" class="col-sm-4  control-label">隐患描述
					<span style="color:red;">*</span>
					</label>
					<div class="col-sm-8">
						<textarea class="form-control" 
						name="hidenInfo" rows="XX" 
						cols="XX"
						msg = "隐患描述" ></textarea>
					</div>
				</div>					
				<div class="form-group col-md-6 col-sm-6">
					<label for="inputgsmc" class="col-sm-4  control-label">上传图片</label>
					<div class="col-sm-8">
						<a href="
							javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl')"
		                        class="btn btn-default">选择图片</a>
					</div>
				</div>
			</div>
			<!--提交按钮-->
			<div class="row">
				<div class="form-group">
				    <div class="col-sm-offset-2 col-sm-10">
					    <input type="hidden" name="hidenFlag" value="0"/>
					    <button type="submit" id="save" onclick="return checkNull()"
					            class="btn btn-primary ">提交</button>	            
					    <a class="btn btn-default" " 
					     href="{:url('hiden/index')}">{:lang('BACK')}</a>
					</div>
			    </div>
		    </div>
		</form>
		
	</div>
	<script src="__STATIC__/js/admin.js"></script>
<script>
  function checkNull()
    {
	     var num=0;
	     var str="";
	     //--------隐患描述是否为空-------------//
	     $("textarea").each(function(n){
	          if($(this).val()=="")
	          {
	               num++;
	               str+=""+$(this).attr("msg")+"不能为空！\r\n";
	          }
	     });
	     //--------input否为空-------------//
	     $("input[type$='text']").each(function(n){
	          if($(this).val()=="")
	          {
	               num++;
	               str+=""+$(this).attr("msg")+"不能为空！\r\n";
	          }
	     });
	     if(num>0)
	     {
	          alert(str);
	          return false;
	     }
	     else
	     {
	          return true;
	     }
	}
</script>
</body>
</html>